package com.laoxu.test.springcloud.controller;

import com.laoxu.test.springcloud.client.UserClient;
import com.laoxu.test.springcloud.model.User;
import com.laoxu.test.springcloud.vo.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RestController;

/**
 * @Description:
 * @Author laoxu
 * @Date 2020/8/15 15:59
 **/
@RestController
public class UserController {
    @Autowired
    UserClient userClient;

    @GetMapping("/user/{id}")
    public Result<User> getById(@PathVariable Integer id){
        return  userClient.getById(id);
    }
}
